﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Client
{
    /// <summary>
    /// Klasse der håndtere events kald til GUIen
    /// </summary>
    internal class GuiInputHandler
    {
        private MainWindow GUI;
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="GuiIn">MainWindow events skal sende videre til<</param>
        public GuiInputHandler(MainWindow GuiIn)
        {
            GUI = GuiIn;
        }

        /// <summary>
        /// Håndtere eventet ChatMessageChange
        /// </summary>
        /// <param name="sender">Afsender af eventet</param>
        /// <param name="e">data der blev sendt med eventet</param>
        public void PushChatMessage(object sender, EventDrivenShare.ChatMessageArgs e)
        {
            GUI.Dispatcher.BeginInvoke(MainWindow.DelegateChatMessage, e);
        }
        /// <summary>
        /// Håndtere eventet ProjectChange
        /// </summary>
        /// <param name="sender">Afsender af eventet</param>
        /// <param name="e">data der blev sendt med eventet</param>
        public void PushProjectData(object sender, EventDrivenShare.ProjectArgs e)
        {
            GUI.Dispatcher.BeginInvoke(MainWindow.DelegateProjectData, e);
        }
    }
}
